package com.example.base.adapter;


import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

public class Tryviewpager extends FragmentPagerAdapter {
  private List<String> title;
  public List<Fragment> mFragmentList;

  public Tryviewpager(FragmentManager fm, List<String> title, List<Fragment> fragments) {

    super(fm);
    this.title = title;
    this.mFragmentList = fragments;
  }


  @Override
  public Fragment getItem(int position) {
    return mFragmentList.get(position);
  }

  @Override
  public int getCount() {
    return mFragmentList.size();
  }

  @Override
  public CharSequence getPageTitle(int position) {
    if (title.size() != 0) {
      return title.get(position);
    } else {
      return null;
    }

  }

}
